package appapi.Vo;

import appapi.common.BaseEntity;
import appapi.common.UpdateGroup;
import appapi.entity.auth.ModuletypeEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 请求对象
 *
 * @author luocheng
 * @version 1.0
 * @date 2023/05/18 15:38
 */
@ApiModel
@Data
@NoArgsConstructor
@TableName("moduletype")
public class EditModuletypeVo  implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "类别ID",required = true)
    @NotNull(message = "类别ID不能为空", groups = {UpdateGroup.class})
    @TableId(type = IdType.AUTO)
    private Long moduTypeId;

    @ApiModelProperty(value = "类别名称",required = true)
    @NotNull(message = "类别名称不能为空")
    private String moduTypeName;

    @ApiModelProperty(value = "排序",required = true)
    @NotNull(message = "排序名称不能为空")
    private Integer moduTypeSort;

    @ApiModelProperty(value = "启用状态：0-启用;1-未启用",required = true)
    @NotNull(message = "启用状态不能为空")
    private Integer moduTypeEnable;

    @ApiModelProperty(value = "备注")
    private String moduTypeNote;

    public ModuletypeEntity vo2Entity(){
        ModuletypeEntity entity = new ModuletypeEntity();
        BeanUtils.copyProperties(this,entity);
        return entity;
    }
}
